package com.cskaoyan.controller.stage;

import com.cskaoyan.model.Goods;
import com.cskaoyan.model.bo.WxGoodsListBO;
import com.cskaoyan.model.vo.*;
import com.cskaoyan.service.WxGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：王李轶群
 * @description：TODO
 * @date ：5/9/22 4:05 PM
 */
@RestController
@RequestMapping("wx/goods")
public class WxGoodsController {
    @Autowired
    WxGoodsService wxGoodsService;

    @GetMapping("count")
    public BaseRespVO<Integer> goodsCount(){
        BaseRespVO<Integer> integerBaseRespVO = wxGoodsService.goodsCount();
        return integerBaseRespVO;
    }

    @GetMapping("category")
    public BaseRespVO<WxGoodsCategoryVO> goodsCategory(Integer id){
        BaseRespVO<WxGoodsCategoryVO> wxGoodsCategoryVOBaseRespVO = wxGoodsService.goodsCategory(id);
        return wxGoodsCategoryVOBaseRespVO;
    }

    @GetMapping("list")
    public BaseRespVO<WxGoodsListVO> goodsList(WxGoodsListBO wxGoodsListBO){
        BaseRespVO<WxGoodsListVO> wxGoodsListVOBaseRespVO = wxGoodsService.goodsList(wxGoodsListBO);
        return wxGoodsListVOBaseRespVO;
    }

    @GetMapping("detail")
    public BaseRespVO<WxGoodsDetailVO> goodsDetail(Integer id){
        BaseRespVO<WxGoodsDetailVO> wxGoodsDetailVOBaseRespVO = wxGoodsService.goodsDetail(id);
        return wxGoodsDetailVOBaseRespVO;
    }

    @GetMapping("related")
    public BaseRespVO<DataVO<Goods>> goodsRelated(Integer id){
        BaseRespVO<DataVO<Goods>> dataVOBaseRespVO = wxGoodsService.goodsRelated(id);
        return dataVOBaseRespVO;
    }
}
